<template>
	<view class="formpanel">
		<form @submit="formSubmit">
			<view class="group border-tb">当事人信息</view>
			<view class="cu-form-group border-b">
				<view class="title">被处罚人</view>
				<view class="text"><input name="RealName" placeholder="请输入被处罚人姓名" placeholder-class="gray" :value="Info.RealName"></input></view>
			</view>
			<view class="cu-form-group border-b">
				<view class="title">联系电话</view>
				<view class="text"><input name="Mobile" type="number" placeholder="请输入被处罚人联系电话" placeholder-class="gray" :value="Info.Mobile"></input></view>
			</view>
			<view class="group border-tb">缴费</view>
			<view class="cu-form-group border-b">
				<view class="title">缴费金额</view>
				<view class="text"><input name="PayMoney" type="number" placeholder="请输入缴费金额" placeholder-class="gray" class="red" :value="Info.PayMoney"></input></view>
			</view>
			<view class="btn">
				<button class="publishs" form-type="submit" v-if="Info.State==0">确定缴费</button>
			</view>
		</form>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Info:{ID:0}
			};
		},
		onLoad(options) {
			this.ID=options.ID;
			this.Find_ParkInfo();
		},
		methods:{
			Find_ParkInfo(){
				var data = {};
				data.ID=this.ID;
				data.Act="Find_ParkInfo";
				this.Util.Loading("加载中...");
				this.Util.Post(data, json=>{
					this.Util.HideLoading();
					uni.stopPullDownRefresh();
					uni.hideNavigationBarLoading();
					this.Info = json.Data.Info;
				});
			},
			formSubmit(e){
				var data = e.detail.value;
				data.Act="Pay_Park";
				data.ID=this.ID;
				if(data.PayMoney.Trim()==""){
					this.Util.Toast("请输入缴费金额");
					return;
				}
				this.Util.Confirm("您确定要缴费吗？",()=>{
					this.Util.Loading("请稍候...");
					this.Util.Post(data, json=>{
						this.Util.HideLoading();
						if(json.State){
							this.Util.Toast(json.Msg, obj=>{
								uni.$emit("Success","");
								uni.navigateBack({
									delta:2
								})
							});
						}else{
							this.Util.Alert(json.Msg);
						}
					});
				});
			}
		}
	}
</script>

<style lang="scss">
	.group{width:100%; height:80rpx; line-height: 80rpx; padding-left:30rpx; font-size:32rpx; margin-top:25rpx; color:#3d7dfd; background-color: #ffffff;
		.number{color:#000000; padding-right:30rpx; float:right;}
		.resign{color:#00c1a8; padding-right:30rpx; float:right;}
	}
</style>
